package com.rowline.admin.module.util.domain;

import com.rowline.admin.module.util.utils.StringUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * ClassName:Log
 * Created by 245167
 * on 2017/8/18  18:46
 * description: 打印日志的公共类
 */
public class Log {

    public static final Logger logger = LoggerFactory.getLogger(Log.class);

    public static void debug(Object obj) {
        logger.debug(createString(obj));
    }

    public static void info(Object obj) {
        logger.info(createString(obj));
    }

    public static void error(Object obj) {
        logger.error(createString(obj));
    }

    private static String createString(Object obj) {
        StringBuilder builder = new StringBuilder("");
        if (null == obj) {
            return builder.toString();
        }
        builder.append(StringUtil.toString(obj));
        return builder.toString();
    }
}
